package sqlite

import (
	"context"
	"database/sql"
)

type Operator interface {
	Table(table string) Operator
	Where(where string, args ...interface{}) Operator
	Limit(limit int) Operator
	Offset(offset int) Operator
	GroupBy(groupby string) Operator
	OrderBy(orderby string) Operator

	Query(fields ...string) (result []map[string]interface{}, err error)
	Insert(fieldWithArg map[string]interface{}) error
	Update(fieldWithArg map[string]interface{}) error
	Delete() error

	Exec(sSql string, args ...interface{}) (sql.Result, error)
	ExecContent(content []byte) error

	WithTransaction(context.Context, *sql.TxOptions, func(tx Operator) error) error

	Close() error
}
